<template>
    <div>
        <h2>展示用户</h2>
        <table>
            <thead>
                <tr>
                    <th>姓名</th>
                    <th>手机</th>
                    <th>邮箱</th>
                    <th>创建时间</th>
                    <th>操作</th>
                </tr>
            </thead>
            <tbody>
                <tr v-for="li in usersList" :key="li.id">
                    <td>{{ li.username }}</td>
                    <td>{{ li.phone }}</td>
                    <td>{{ li.email }}</td>
                    <td>{{ li.ctime }}</td>
                    <td>
                        <button>删除</button>
                        <button>编辑</button>
                    </td>
                </tr>
            </tbody>

        </table>
    </div>
</template>
<script>
import { getUsersApi } from '../api/users.js'
export default {
    data() {
        return {
            usersList: []
        }
    },
    created() {
        this.getUers();
    },
    methods: {
        async getUers() {
            const res = await getUsersApi();
            this.usersList = res;
        }
    }


}
</script>